/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.dialog;

import controller.KeyBordJogoEventos;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 *
 * @author Adriano
 */
public class DialogExit {
    private static DialogExit intancia;
    private static Stage s;
    
    public DialogExit() {
        try{
            Parent root = FXMLLoader.load(getClass().getResource("/view/jogador/Dialog.fxml"));
            Scene scene = new Scene(root,Color.web("0xdfdfdfff") );
            scene.setOnKeyPressed(new KeyBordJogoEventos());
            s = new Stage(StageStyle.TRANSPARENT);
            s.setScene(scene);
            s.initModality(Modality.APPLICATION_MODAL);
        }catch(Exception e){}
    }

    public static DialogExit getIntancia() {
        if (intancia == null) {
            intancia = new DialogExit(); 
        }
        return intancia;
    }
    
    public void show(){
        s.show();
    }
    
    public void close(){
        s.close();
    }
}
